package com.lex.newbasketball.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ListView;

import com.lex.newbasketball.R;
import com.lex.newbasketball.adapter.MyFriendAdapter;
import com.lex.newbasketball.adapter.WonderAdapter;
import com.lex.newbasketball.entity.MyFriendEntity;
import com.lex.newbasketball.entity.WonderEntity;
import com.sam.ui.base.fragment.BaseFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/7/21.
 */
public class MyFriendsFragment extends BaseFragment{
    private ListView show_time_list;
    private static MyFriendsFragment self;

    public synchronized static MyFriendsFragment getInstance(){
        if (self == null) self = new MyFriendsFragment();
        return self;
    };

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_view);
    }

    @Override
    protected void findView() {
        show_time_list = (ListView) findViewById(R.id.show_time_list);
    }

    @Override
    protected void initView() {
        MyFriendAdapter myFriendAdapter = new MyFriendAdapter(getActivity(),getRecordData());
        show_time_list.setAdapter(myFriendAdapter);
        show_time_list.addHeaderView(View.inflate(getActivity(),R.layout.fragment_my_friends_wonder,null));
    }

    private List<MyFriendEntity>getRecordData(){
        List<MyFriendEntity>myFriendEntityList = new ArrayList<>();
        myFriendEntityList.add(new MyFriendEntity(R.mipmap.head_img,R.mipmap.test_share_pic_1,
                "斯蒂夫","哈哈哈","华为","20","你看我屌不？"));
        myFriendEntityList.add(new MyFriendEntity(R.mipmap.head_img,R.mipmap.test_share_pic_1,
                "蕾丝","武汉市","互相伤害啊","20","你看我屌不？"));
        return myFriendEntityList;
    }


}
